<template>
    <p>这是product的一个界面</p>
</template>

<script>
export default {
    watch:{
        $$route(newVal,oldVal){
            console.log('newVal',newVal);
            console.log('oldVal',oldVal);
            this.init()
        }
    },
    methods:{
        init(){
            console.log("初始化数据");
            console.log("现在id是"+this.$route.params.id);
        }
    },
    mounted(){
        console.log(this.$route);
    }
}
</script>
